package lab02.test36;

/**
 * Created by lenovo on 2017/11/20.
 */
abstract class Student {
    final static int CourseNo = 3;
    String name;
    String type;
    int[]  courses;
    String  courseGrade;

    public Student(String name) {
        this.name = name;
        courses = new int[CourseNo];
        courseGrade=""; //初始化courseGrade为空串
    }
    public abstract void calculateGrade();

    public String getName( ) {
        return name;
    }
    public String getType( )  {
        return type; //返回学生类型
    }

    public String getCourseGrade( ) {
        return courseGrade;
    }

    public int getCourseScore(int courseNumber)  {
        return courses[courseNumber];
    }

    public void setName(String name)  {
        this.name = name;
    }

    public void setType(String type)  {
        this.type = type;
    }

    public void setCourseScore(int courseNumber, int courseScore) {
        courses[courseNumber]=courseScore; //按课程索引号设置课程成绩
    }
}


